//
//  MainTabBarController.m
//  ucas_on_hand
//
//  Created by DaveLam on 15/1/29.
//  Copyright (c) 2015年 ucas. All rights reserved.
//

#import "MainTabBarController.h"

@interface MainTabBarController ()

@end

@implementation MainTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UINavigationItem* titleItem=self.navigationItem;
    titleItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"menu"] style:UIBarButtonItemStyleDone target:self action:@selector(pushMenu:)];
    titleItem.rightBarButtonItem=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"home"] style:UIBarButtonItemStyleDone target:self action:@selector(pushHome:)];
    [[self.navigationController navigationBar] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [[self.navigationController navigationBar] setTintColor:[UIColor whiteColor]];
    [[self.navigationController navigationBar] setBarTintColor:[UIColor colorWithRed:59/255.0 green:175/255.0 blue:218/255.0 alpha:1]];
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.homeViewController=[[HomeViewController alloc] initWithStyle:UITableViewStylePlain];
    [self.revealSideViewController preloadViewController:self.homeViewController forSide:PPRevealSideDirectionRight withOffset:70.0];
}
-(IBAction)pushMenu:(id)sender{
    
}

-(IBAction)pushHome:(id)sender{
    [self.revealSideViewController pushOldViewControllerOnDirection:PPRevealSideDirectionRight animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
